package hku.cs.lunuo.tools;

public class RevertCond {
	public static String convert(String cond){
		StringBuffer result = new StringBuffer();
		int index = -1;
		if((index = cond.indexOf(">="))>0){
			result.append(cond.substring(0, index));
			result.append("<");
			result.append(cond.substring(index+2, cond.length()));
			return result.toString();
		}else if((index = cond.indexOf("<="))>0){
			result.append(cond.substring(0, index));
			result.append(">");
			result.append(cond.substring(index+2, cond.length()));
			return result.toString();
		}else if((index = cond.indexOf("<"))>0){
			result.append(cond.substring(0, index));
			result.append(">=");
			result.append(cond.substring(index+1, cond.length()));
			return result.toString();
		}else if((index = cond.indexOf(">"))>0){
			result.append(cond.substring(0, index));
			result.append("<=");
			result.append(cond.substring(index+1, cond.length()));
			return result.toString();
		}else if((index = cond.indexOf("=="))>0){
			result.append(cond.substring(0, index));
			result.append("!=");
			result.append(cond.substring(index+2, cond.length()));
			return result.toString();
		}else if((index = cond.indexOf("!="))>0){
			result.append(cond.substring(0, index));
			result.append("==");
			result.append(cond.substring(index+2, cond.length()));
			return result.toString();
		}
		else
			return cond;
	}
}
